package br.cefetpe.tsi.game.base.views;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridBagLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;

import javax.swing.JFrame;

import br.cefetpe.tsi.game.base.Roullette;

public class Test extends JFrame {
	private static final long serialVersionUID = 3935888469421402997L;
	private static Graphics2D g2;
	private static TriangleView tv;
	private static Roullette r; 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Test t = new Test();
		t.setVisible(true);
		t.setSize(800, 600);
		t.setLayout(new GridBagLayout());
		t.addMouseListener(new MouseAdapter(){
			
			public void mouseClicked(MouseEvent me){
				Test t = (Test)me.getSource();
				System.out.println("Clique!!!");
				System.out.println(Test.r);
				Test.tv.drawRoullette(Test.g2, Test.r);
				t.repaint();
			}
		});
	}

	@Override
	public void paint(Graphics g) {

		Test.g2 = (Graphics2D) g;
		Point2D.Double top = new Point2D.Double(150, 180);
		HexagonShape hs = new HexagonShape(top, 50);
		g2.draw(hs);
//		Triangle t = new Triangle(top, 50.0d);
		// g2.setColor(Color.BLACK);
		// g2.fill(t);
		//TriangleView tv = new TriangleView(top, 50.0d, Color.yellow);
//		Test.tv = new TriangleView(t);
//		Disk d = new Disk(ColorSet.SET0);
//		tv.drawDisk(g2, d);
//		
//		
//		d.rotateDisk();
//		tv.drawDisk(g2, d);
//		tv.draw(g2);
//		tv.drawDisk(g2, new Disk(ColorSet.SET0));
//		tv.translate(g2, 87, 30);
//		tv.drawDisk(g2, new Disk(ColorSet.SET1));
//		tv.translate(g2, 87, 30+300 -60);
//		tv.drawDisk(g2, new Disk(ColorSet.SET2));
//		tv.translate(g2, 87, 30+2*300 - 60);
//		tv.drawDisk(g2, new Disk(ColorSet.SET3));
//		tv.translate(g2, 87, 30+3*300 - 60);
//		tv.drawDisk(g2, new Disk(ColorSet.SET4));
//		tv.translate(g2, 87, 30+4*300 - 60);
//		tv.drawDisk(g2, new Disk(ColorSet.SET5));
//		tv.translate(g2, 87, 30+5*300 - 60);
//		tv.drawDisk(g2, new Disk(ColorSet.SET6));
		
//		 Test.r = new Roullette();
//		 r.rotateDisk(3, 5);
//		 tv.drawRoullette(g2, r);
//	 
//		
//		tv.color = Color.green;
//		tv.rotate(60, g2);
//		// tv.draw(g);

	}

}
